import java.util.*;
	import java.io.*;
	import edu.vanderbilt.isis.sm.*; 
	public class VPCReader implements IDataReader {
	private TopLevelVPC.REGION_T.STATE_T state;
	private IDataProvider dataProvider;
	private IDataPrinter dataPrinter;
	public VPCReader (TopLevelVPC.REGION_T.STATE_T state, IDataProvider dataProvider, IDataPrinter dataPrinter) {
		this.state = state;
		this.dataProvider = dataProvider;
		this.dataPrinter = dataPrinter;
		this.dataProvider.setHasEvents(12, 0);
	}
	// Implemented from IDataReader for custom inputting 
	public void setInput() {
		ArrayList<String> inputs = new ArrayList<String>();
		for (int i=0; i < 12; i++) {
			inputs.add(dataProvider.readData());
		}
		dataProvider.advance();
		if (inputs.size() == 12) { // A little error-checking
			int val_0 = Integer.parseInt(inputs.get(0));;
			int val_1 = Integer.parseInt(inputs.get(1));;
			int val_2 = Integer.parseInt(inputs.get(2));;
			int val_3 = Integer.parseInt(inputs.get(3));;
			int val_4 = Integer.parseInt(inputs.get(4));;
			int val_5 = Integer.parseInt(inputs.get(5));;
			int val_6 = Integer.parseInt(inputs.get(6));;
			int val_7 = Integer.parseInt(inputs.get(7));;
			int val_8 = Integer.parseInt(inputs.get(8));;
			int val_9 = Integer.parseInt(inputs.get(9));;
			boolean val_10 = Boolean.parseBoolean(inputs.get(10));;
			int val_11 = Integer.parseInt(inputs.get(11));;
		state.setData( val_0,  val_1,  val_2,  val_3,  val_4,  val_5,  val_6,  val_7,  val_8,  val_9,  val_10,  val_11 );
		}
	}
	public void writeOutput() {
		ArrayList<String> outputs = new ArrayList<String>();
		if (dataPrinter != null){
			dataPrinter.writeData(outputs);
			dataProvider.advance();
		}
	}
	public boolean hasData() {
		return this.dataProvider.hasData();
	}
	public String readEvent() {
		return this.dataProvider.readEvent();
	}
};